Researchers have assessed the proteome in different regions of the heart for 3 patients (identifiers 3, 4, and 8). For each patient they sampled the left atrium (LA), right atrium (RA), left ventricle (LV) and the right ventricle (RV). The data are a small subset of the public dataset PXD006675 on PRIDE.
Suppose that researchers are mainly interested in comparing the ventricular to the atrial proteome. Particularly, they would like to compare the left atrium to the left ventricle, the right atrium to the right ventricle, the average ventricular vs atrial proteome and if ventricular vs atrial proteome shifts differ between left and right heart region.
We first import the peptides.txt file. This is the file that contains your peptide-level intensities. For a MaxQuant search [6], this peptides.txt file can be found by default in the “path_to_raw_files/combined/txt/” folder from the MaxQuant output, with “path_to_raw_files” the folder where raw files were saved. In this tutorial, we will use a MaxQuant peptides file from MaxQuant that can be found in the data tree of the SGA2020 github repository https://github.com/statOmics/SGA2020/tree/data/quantification/heart .
To import the data we use the QFeatures package.
We generate the object peptideRawFile with the path to the peptideRaws.txt file. Using the grepEcols function, we find the columns that contain the expression data of the peptideRaws in the peptideRaws.txt file.
library(tidyverse)
library(limma)
library(QFeatures)
library(msqrob2)
library(plotly)
peptidesFile <- "https://raw.githubusercontent.com/statOmics/SGA2020/data/quantification/heart/peptides.txt"
ecols <- MSnbase::grepEcols(
peptidesFile,
"Intensity ",
split = "\t")
pe <- readQFeatures(
table = peptidesFile,
fnames = 1,
ecol = ecols,
name = "peptideRaw", sep="\t")
pe## An instance of class QFeatures containing 1 assays:
## [1] peptideRaw: SummarizedExperiment with 31319 rows and 12 columns
pe[["peptideRaw"]]## class: SummarizedExperiment
## dim: 31319 12
## metadata(0):
## assays(1): ''
## rownames(31319): AAAAAAAAAK AAAAAAAAEQQSSNGPVK ... YYTPVPCESATAK
## YYTYLIMNK
## rowData names(91): Sequence N.term.cleavage.window ...
## Oxidation..M..site.IDs MS.MS.Count
## colnames(12): Intensity.LA3 Intensity.LA4 ... Intensity.RV4
## Intensity.RV8
## colData names(0):
We will make use from data wrangling functionalities from the tidyverse package. The %>% operator allows us to pipe the output of one function to the next function.
colData(pe)$region <- substr(
colnames(pe[["peptideRaw"]]),
11,
12) %>%
unlist %>%
as.factor
colData(pe)$patient <- substr(
colnames(pe[["peptideRaw"]]),
13,
13) %>%
unlist %>%
as.factorWe calculate how many non zero intensities we have per peptide and this will be useful for filtering.
rowData(pe[["peptideRaw"]])$nNonZero <- rowSums(assay(pe[["peptideRaw"]]) > 0)Peptides with zero intensities are missing peptides and should be represent with a NA value rather than 0.
pe <- zeroIsNA(pe, "peptideRaw") # convert 0 to NAWe can inspect the missingness in our data with the plotNA() function provided with MSnbase. 63% of all peptide intensities are missing and for some peptides we do not even measure a signal in any sample. The missingness is similar across samples.
MSnbase::plotNA(assay(pe[["peptideRaw"]])) +
xlab("Peptide index (ordered by data completeness)")This section preforms standard preprocessing for the peptide data. This include log transformation, filtering and summarisation of the data.
pe <- logTransform(pe, base = 2, i = "peptideRaw", name = "peptideLog")
limma::plotDensities(assay(pe[["peptideLog"]]))In our approach a peptide can map to multiple proteins, as long as there is none of these proteins present in a smaller subgroup.
pe[["peptideLog"]] <-
pe[["peptideLog"]][rowData(pe[["peptideLog"]])$Proteins
%in% smallestUniqueGroups(rowData(pe[["peptideLog"]])$Proteins),]We now remove the contaminants, peptides that map to decoy sequences, and proteins which were only identified by peptides with modifications.
First look to the names of the variables for the peptide features
pe[["peptideLog"]] %>%
rowData %>%
names## [1] "Sequence" "N.term.cleavage.window"
## [3] "C.term.cleavage.window" "Amino.acid.before"
## [5] "First.amino.acid" "Second.amino.acid"
## [7] "Second.last.amino.acid" "Last.amino.acid"
## [9] "Amino.acid.after" "A.Count"
## [11] "R.Count" "N.Count"
## [13] "D.Count" "C.Count"
## [15] "Q.Count" "E.Count"
## [17] "G.Count" "H.Count"
## [19] "I.Count" "L.Count"
## [21] "K.Count" "M.Count"
## [23] "F.Count" "P.Count"
## [25] "S.Count" "T.Count"
## [27] "W.Count" "Y.Count"
## [29] "V.Count" "U.Count"
## [31] "O.Count" "Length"
## [33] "Missed.cleavages" "Mass"
## [35] "Proteins" "Leading.razor.protein"
## [37] "Start.position" "End.position"
## [39] "Gene.names" "Protein.names"
## [41] "Unique..Groups." "Unique..Proteins."
## [43] "Charges" "PEP"
## [45] "Score" "Identification.type.LA3"
## [47] "Identification.type.LA4" "Identification.type.LA8"
## [49] "Identification.type.LV3" "Identification.type.LV4"
## [51] "Identification.type.LV8" "Identification.type.RA3"
## [53] "Identification.type.RA4" "Identification.type.RA8"
## [55] "Identification.type.RV3" "Identification.type.RV4"
## [57] "Identification.type.RV8" "Fraction.Average"
## [59] "Fraction.Std..Dev." "Fraction.1"
## [61] "Fraction.2" "Fraction.3"
## [63] "Fraction.4" "Fraction.5"
## [65] "Fraction.6" "Fraction.7"
## [67] "Fraction.8" "Fraction.100"
## [69] "Experiment.LA3" "Experiment.LA4"
## [71] "Experiment.LA8" "Experiment.LV3"
## [73] "Experiment.LV4" "Experiment.LV8"
## [75] "Experiment.RA3" "Experiment.RA4"
## [77] "Experiment.RA8" "Experiment.RV3"
## [79] "Experiment.RV4" "Experiment.RV8"
## [81] "Intensity" "Reverse"
## [83] "Potential.contaminant" "id"
## [85] "Protein.group.IDs" "Mod..peptide.IDs"
## [87] "Evidence.IDs" "MS.MS.IDs"
## [89] "Best.MS.MS" "Oxidation..M..site.IDs"
## [91] "MS.MS.Count" "nNonZero"
No information on decoys.
pe[["peptideLog"]] <- pe[["peptideLog"]][rowData(pe[["peptideLog"]])$
Potential.contaminant != "+", ]I will skip this step for the moment. Large protein groups file needed for this.
We keep peptides that were observed at last twice.
pe[["peptideLog"]] <- pe[["peptideLog"]][rowData(pe[["peptideLog"]])$nNonZero >= 2, ]
nrow(pe[["peptideLog"]])## [1] 17432
We keep 17432 peptides after filtering.
pe <- normalize(pe, i = "peptideLog", method = "quantiles", name = "peptideNorm")After quantile normalisation the density curves for all samples coincide.
limma::plotDensities(assay(pe[["peptideNorm"]]))This is more clearly seen is a boxplot.
boxplot(assay(pe[["peptideNorm"]]), col = palette()[-1],
main = "Peptide distribtutions after normalisation", ylab = "intensity")We can visualize our data using a Multi Dimensional Scaling plot, eg. as provided by the limma package.
limma::plotMDS(assay(pe[["peptideNorm"]]), col = as.numeric(colData(pe)$region))The first axis in the plot is showing the leading log fold changes (differences on the log scale) between the samples.
We use robust summarization in aggregateFeatures. This is the default workflow of aggregateFeatures so you do not have to specifiy the argument fun. However, because we compare methods we have included the fun argument to show the summarization method explicitely.
pe <- aggregateFeatures(pe,
i = "peptideNorm",
fcol = "Proteins",
na.rm = TRUE,
name = "proteinRobust",
fun = MsCoreUtils::robustSummary)## Your quantitative and row data contain missing values. Please read the
## relevant section(s) in the aggregateFeatures manual page regarding the
## effects of missing values on data aggregation.
plotMDS(assay(pe[["proteinRobust"]]), col = as.numeric(colData(pe)$region))We model the protein level expression values using msqrob. By default msqrob2 estimates the model parameters using robust regression.
pe <- msqrob(
object = pe,
i = "proteinRobust",
formula = ~ region + patient)First, we extract the parameter names of the model.
getCoef(rowData(pe[["proteinRobust"]])$msqrobModels[[1]])## [1] NA
L <- makeContrast(
c(
"regionLV = 0",
"regionRV-regionRA = 0",
"0.5*(regionRV+regionLV)-0.5*(regionRA) = 0","(regionRV-regionRA)-(regionLV) = 0"),
parameterNames =
c(
"regionLV",
"regionRA",
"regionRV")
)
pe <- hypothesisTest(object = pe, i = "proteinRobust", contrast = L,overwrite=TRUE)volcano <- ggplot(rowData(pe[["proteinRobust"]])$regionLV,
aes(x = logFC, y = -log10(pval), color = adjPval < 0.05)) +
geom_point(cex = 2.5) +
scale_color_manual(values = alpha(c("black", "red"), 0.5)) + theme_minimal()
volcanoWe first select the names of the proteins that were declared signficant.
sigNames <- rowData(pe[["proteinRobust"]])$regionLV %>%
rownames_to_column("proteinRobust") %>%
filter(adjPval<0.05) %>%
pull(proteinRobust)
heatmap(assay(pe[["proteinRobust"]])[sigNames, ])There are 211 proteins significantly differentially expressed at the 5% FDR level.
rowData(pe[["proteinRobust"]])$regionLV %>%
filter(adjPval<0.05)## logFC se df t pval adjPval
## A6NMZ7 -2.267329 0.4773591 9.385413 -4.749734 9.302140e-04 0.0232948852
## A8MTT3 -3.368826 0.8032193 7.070471 -4.194155 3.975423e-03 0.0461447703
## O00180 -4.096722 0.7724957 8.385413 -5.303229 6.215327e-04 0.0197142388
## O00264 -1.999242 0.3827164 9.079390 -5.223821 5.310576e-04 0.0181177896
## O00303 -1.477605 0.3444231 9.008150 -4.290088 2.015605e-03 0.0338155234
## O00567 -2.329642 0.6192522 9.376799 -3.762024 4.156038e-03 0.0466119152
## O14967 -2.393131 0.4223134 8.430438 -5.666718 3.902575e-04 0.0152350505
## O14980 -1.230352 0.2498369 9.382448 -4.924620 7.249103e-04 0.0201584654
## O15111 -1.770061 0.4097076 7.141811 -4.320302 3.319506e-03 0.0425104704
## O15116 -3.262825 0.6533382 5.390877 -4.994083 3.344175e-03 0.0425104704
## O15230 -1.415011 0.3058820 9.044210 -4.626003 1.227722e-03 0.0270899568
## O43143 -1.010978 0.2650086 9.289616 -3.814887 3.889551e-03 0.0458869490
## O43464 -1.900721 0.3799226 9.072346 -5.002915 7.184453e-04 0.0201584654
## O43677 -2.758090 0.4792076 7.933870 -5.755523 4.395852e-04 0.0159349642
## O60262 -1.514780 0.3809638 8.388576 -3.976177 3.711841e-03 0.0448514075
## O60476 -2.858033 0.6987082 7.449546 -4.090453 4.053589e-03 0.0462918574
## O60760 -3.500029 0.5842390 8.385413 -5.990748 2.714724e-04 0.0136858216
## O75348 -1.846417 0.4493725 9.377764 -4.108879 2.420962e-03 0.0364040950
## O75368 -2.290376 0.2718512 9.251939 -8.425109 1.227577e-05 0.0046574804
## O75475 -1.951060 0.4885410 9.296501 -3.993647 2.942591e-03 0.0405659955
## O75746 -1.578482 0.3695373 8.893946 -4.271509 2.132704e-03 0.0348421424
## O75828 -1.641739 0.3592450 9.385413 -4.569971 1.208704e-03 0.0269633984
## O94875-10 2.321238 0.3122508 8.958355 7.433891 4.058858e-05 0.0070837903
## O94919 -1.158582 0.2941090 9.248102 -3.939294 3.233113e-03 0.0425104704
## O95486 -1.500300 0.4068449 9.187799 -3.687646 4.841264e-03 0.0479403182
## O95865 -2.158932 0.2871753 9.385413 -7.517818 2.878881e-05 0.0070101764
## O95980 -2.552421 0.4176977 7.980660 -6.110688 2.888868e-04 0.0136858216
## P00325 -2.108814 0.3251595 9.141096 -6.485476 1.056883e-04 0.0097521471
## P00748 -2.003056 0.3702529 9.091376 -5.409968 4.128347e-04 0.0156430362
## P01008 -1.547192 0.4205447 9.310907 -3.679019 4.797492e-03 0.0479403182
## P01024 -1.148297 0.2873908 9.197920 -3.995596 2.997197e-03 0.0408343011
## P01031 -1.322378 0.3017394 8.183937 -4.382518 2.216544e-03 0.0351529951
## P01034 -1.689330 0.4126063 8.837162 -4.094289 2.805755e-03 0.0401104347
## P01042 -2.256316 0.4659486 7.210294 -4.842414 1.723078e-03 0.0317986167
## P01699 -4.025961 0.6965009 6.314916 -5.780266 9.791668e-04 0.0236631988
## P02452 -3.226193 0.4112622 8.367424 -7.844614 3.915504e-05 0.0070837903
## P02461 -3.597666 0.8096938 8.323445 -4.443242 1.958139e-03 0.0334035492
## P02743 -2.273778 0.3999916 9.385413 -5.684565 2.568150e-04 0.0136858216
## P02747 -2.680914 0.4712559 7.138784 -5.688871 6.937261e-04 0.0198707711
## P02775 -1.952126 0.4075050 9.385413 -4.790435 8.772293e-04 0.0229384726
## P02776 -1.748718 0.4069507 7.718405 -4.297123 2.853578e-03 0.0402275282
## P03950 -2.214295 0.5408135 8.216113 -4.094378 3.273728e-03 0.0425104704
## P04003 -1.479053 0.3338506 9.090898 -4.430283 1.606557e-03 0.0310600954
## P04004 -1.633973 0.3854552 8.981078 -4.239073 2.187612e-03 0.0349673387
## P04083 -1.524538 0.3158141 9.385413 -4.827329 8.319849e-04 0.0225190590
## P04196 -1.917181 0.3881943 7.683140 -4.938714 1.279687e-03 0.0276357890
## P04209 1.316899 0.3151619 9.167154 4.178483 2.287341e-03 0.0354450475
## P04275 -1.054100 0.2849243 8.991784 -3.699577 4.931561e-03 0.0483626489
## P04843 -2.051639 0.5456574 8.660976 -3.759939 4.804631e-03 0.0479403182
## P05060 -2.649749 0.6720512 7.305570 -3.942778 5.126775e-03 0.0495588267
## P05455 -1.204229 0.2854061 9.178555 -4.219353 2.145452e-03 0.0348421424
## P05546 -1.915671 0.2708975 9.198639 -7.071573 5.234328e-05 0.0070837903
## P05997 -3.068864 0.5429778 8.864434 -5.651913 3.307544e-04 0.0141028305
## P06727 -1.358368 0.3048521 8.884167 -4.455826 1.638363e-03 0.0312643241
## P06858 1.795244 0.3596173 9.218266 4.992094 6.949876e-04 0.0198707711
## P07357 -1.154912 0.2950375 9.290174 -3.914458 3.330346e-03 0.0425104704
## P07384 -1.106938 0.2881747 9.333139 -3.841205 3.700646e-03 0.0448514075
## P07451 -1.841539 0.2910138 9.385413 -6.328012 1.135993e-04 0.0100263719
## P08294 -2.756458 0.4335622 7.979491 -6.357700 2.211992e-04 0.0132068941
## P08311 -1.326822 0.3393339 8.579011 -3.910077 3.910563e-03 0.0458869490
## P08582 -1.663860 0.3857501 9.299314 -4.313310 1.809261e-03 0.0329077784
## P08590 7.566945 0.4227679 9.117913 17.898582 2.053818e-08 0.0000416925
## P08670 -1.482725 0.3924566 8.643328 -3.778060 4.692846e-03 0.0479403182
## P09619 -1.675728 0.3807310 9.154490 -4.401345 1.647923e-03 0.0312643241
## P10916 6.908674 0.5190748 7.385413 13.309594 1.989661e-06 0.0013463376
## P12110 -2.136456 0.3667316 8.535409 -5.825667 3.078203e-04 0.0138861173
## P12814 -1.726194 0.4239901 8.144626 -4.071308 3.444595e-03 0.0431637565
## P12883 4.333125 0.3637861 9.255194 11.911187 6.384669e-07 0.0006480439
## P13533 -4.313925 0.6516590 9.115028 -6.619911 9.149075e-05 0.0097521471
## P14543 -1.384551 0.3678338 9.204669 -3.764065 4.281560e-03 0.0472367744
## P14550 -1.394080 0.3100035 8.301450 -4.496981 1.831812e-03 0.0329077784
## P14555 -4.594903 0.9455710 6.867951 -4.859396 1.937676e-03 0.0334035492
## P14854 2.300663 0.3037112 8.346841 7.575168 5.144676e-05 0.0070837903
## P15924 1.274221 0.3034579 9.350459 4.199004 2.123114e-03 0.0348421424
## P18428 -2.002577 0.3365444 9.013977 -5.950411 2.139095e-04 0.0131586732
## P20774 -2.236774 0.5631895 8.210882 -3.971618 3.900286e-03 0.0458869490
## P21810 -3.380254 0.4548500 8.304055 -7.431580 6.086105e-05 0.0077217455
## P23083 -4.274293 0.5581240 7.385413 -7.658322 9.118523e-05 0.0097521471
## P23434 1.126822 0.3062675 9.385413 3.679208 4.731628e-03 0.0479403182
## P24311 1.725765 0.4048607 9.295713 4.262615 1.954009e-03 0.0334035492
## P24844 -2.551801 0.4140400 9.330669 -6.163176 1.427449e-04 0.0112127114
## P25311 -1.476798 0.3658030 8.673237 -4.037141 3.173695e-03 0.0422551508
## P25940 -1.680300 0.4292504 9.043784 -3.914499 3.507389e-03 0.0436809796
## P26447 -1.877769 0.4593883 8.774968 -4.087542 2.876360e-03 0.0402690349
## P29622 -2.114870 0.2991501 9.385413 -7.069595 4.735836e-05 0.0070837903
## P30405 -1.540274 0.3587630 9.385413 -4.293290 1.825246e-03 0.0329077784
## P31994-2 -1.655566 0.3017732 8.992524 -5.486128 3.882070e-04 0.0152350505
## P32119 -1.348354 0.3464470 7.636769 -3.891950 5.030220e-03 0.0488581168
## P34932 -1.163429 0.2608932 9.385413 -4.459407 1.423246e-03 0.0286058421
## P35442 -2.334260 0.3655617 8.385413 -6.385405 1.734893e-04 0.0116347170
## P36021 -3.138301 0.5174695 8.385413 -6.064707 2.492526e-04 0.0136858216
## P36551 -1.338543 0.3106105 9.112223 -4.309393 1.907751e-03 0.0334035492
## P36955 -2.323620 0.3325722 8.456893 -6.986813 8.720351e-05 0.0097521471
## P40261 -2.306727 0.4169709 9.340024 -5.532105 3.196173e-04 0.0141028305
## P41240 -1.569148 0.3075870 8.922337 -5.101476 6.615098e-04 0.0198707711
## P45877 -1.259792 0.2861984 9.343571 -4.401814 1.567554e-03 0.0305974442
## P46060 -1.970642 0.3436046 8.385413 -5.735204 3.666325e-04 0.0148852775
## P46063 -1.386912 0.2873890 9.154885 -4.825907 8.947702e-04 0.0229921959
## P46821 -2.182822 0.2654404 9.385413 -8.223396 1.372956e-05 0.0046574804
## P48681 -1.330081 0.2756444 9.321612 -4.825351 8.506867e-04 0.0227222905
## P49207 -1.534829 0.3249990 8.970773 -4.722565 1.094874e-03 0.0255012598
## P49458 -2.320823 0.5006356 7.120983 -4.635753 2.276811e-03 0.0354450475
## P49773 -1.295274 0.3495513 9.385413 -3.705532 4.537746e-03 0.0479403182
## P50552 -1.523119 0.3245142 9.074476 -4.693535 1.105473e-03 0.0255012598
## P50991 -1.786149 0.4735903 8.685139 -3.771507 4.698084e-03 0.0479403182
## P51665 -1.274787 0.3456226 9.194991 -3.688379 4.829228e-03 0.0479403182
## P51884 -2.402234 0.3614104 7.936878 -6.646831 1.671984e-04 0.0116347170
## P51888 -3.199549 0.4165978 6.959924 -7.680186 1.216958e-04 0.0102934364
## P54577 -1.309794 0.3255176 8.964139 -4.023729 3.025715e-03 0.0409480105
## P54652 -1.585922 0.3969039 9.007166 -3.995732 3.125514e-03 0.0420185016
## P56199 -1.282712 0.3337866 8.647866 -3.842911 4.254853e-03 0.0471986376
## P56539 -2.051918 0.4159611 8.553679 -4.932956 9.409757e-04 0.0232948852
## P60468 -1.522924 0.3550773 8.241406 -4.288994 2.478687e-03 0.0367279887
## P62745 -1.495470 0.3945560 8.788016 -3.790261 4.470456e-03 0.0479403182
## P62760 -1.929645 0.4686939 9.120970 -4.117068 2.536151e-03 0.0370387577
## P80723 -1.638539 0.4231920 7.910668 -3.871858 4.831898e-03 0.0479403182
## Q04721 1.531039 0.3675191 9.201253 4.165877 2.312326e-03 0.0355607743
## Q04941 -1.954543 0.5132443 9.127049 -3.808212 4.059089e-03 0.0462918574
## Q06828 -4.209189 0.6775919 9.003303 -6.211983 1.563556e-04 0.0116347170
## Q07954 -1.674832 0.3146216 9.385413 -5.323322 4.161202e-04 0.0156430362
## Q08945 -2.071352 0.4670698 8.385413 -4.434781 1.945267e-03 0.0334035492
## Q12996 -1.667403 0.3663886 7.207709 -4.550913 2.444199e-03 0.0364832579
## Q13478 -1.620268 0.3970937 8.994941 -4.080316 2.759957e-03 0.0397355500
## Q13636 -3.085924 0.6708563 5.941397 -4.599978 3.785567e-03 0.0452041222
## Q13641 -2.094962 0.4829370 7.050947 -4.337963 3.346915e-03 0.0425104704
## Q14011 -2.439155 0.5991974 8.231467 -4.070703 3.371520e-03 0.0425104704
## Q14019 -3.973669 0.8363384 6.385413 -4.751270 2.669003e-03 0.0387005369
## Q14195-2 -2.527278 0.4943182 9.262403 -5.112654 5.795993e-04 0.0186759790
## Q14254 -1.392125 0.3457572 7.385413 -4.026309 4.491644e-03 0.0479403182
## Q14258 -1.359986 0.3561261 8.157903 -3.818833 4.915538e-03 0.0483626489
## Q14764 -1.625976 0.2901417 9.385413 -5.604074 2.855212e-04 0.0136858216
## Q15113 -2.755021 0.4253583 9.188121 -6.476942 1.043206e-04 0.0097521471
## Q15274 -1.928288 0.3958755 7.757883 -4.870945 1.352460e-03 0.0283040542
## Q16082 -1.361982 0.3713096 9.207589 -3.668050 4.974480e-03 0.0485490120
## Q16647 -2.787698 0.3824272 9.156725 -7.289485 4.215454e-05 0.0070837903
## Q1KMD3 -1.494563 0.3712572 9.051771 -4.025682 2.957521e-03 0.0405659955
## Q2TAA5 -1.319245 0.3143146 9.249693 -4.197212 2.180381e-03 0.0349673387
## Q53GG5-2 -2.923374 0.6214767 8.429675 -4.703916 1.330845e-03 0.0282213738
## Q53GQ0 -2.430853 0.3948274 9.334954 -6.156748 1.436111e-04 0.0112127114
## Q53T59 -1.852124 0.4344248 7.876061 -4.263395 2.848653e-03 0.0402275282
## Q5JPH6 3.506017 0.7033283 6.212234 4.984894 2.252977e-03 0.0354450475
## Q5M9N0 -3.537065 0.7427497 8.350040 -4.762123 1.263903e-03 0.0275884108
## Q5NDL2 -2.337629 0.4766026 8.686198 -4.904777 9.339866e-04 0.0232948852
## Q5VIR6-4 -1.755057 0.3758054 9.130015 -4.670123 1.124260e-03 0.0256432250
## Q6IC98 -1.126652 0.3015080 8.888308 -3.736724 4.752541e-03 0.0479403182
## Q6P1N0 -1.699604 0.4098304 6.936107 -4.147091 4.397857e-03 0.0479403182
## Q6P587 5.677610 1.3549193 6.518479 4.190368 4.784000e-03 0.0479403182
## Q6SZW1 -2.563687 0.5126523 7.385413 -5.000831 1.334607e-03 0.0282213738
## Q6UWY5 -3.253229 0.3888996 9.170135 -8.365215 1.376595e-05 0.0046574804
## Q6YN16 1.527167 0.3496754 9.222955 4.367385 1.701929e-03 0.0316964755
## Q6ZSY5 -1.520789 0.3699133 9.170791 -4.111204 2.529229e-03 0.0370387577
## Q7L4S7 -1.747450 0.3202677 7.157555 -5.456217 8.813797e-04 0.0229384726
## Q7LBR1 -2.851457 0.7432377 9.385413 -3.836534 3.689530e-03 0.0448514075
## Q7Z3T8 -1.576843 0.4157303 8.413206 -3.792946 4.821659e-03 0.0479403182
## Q86VU5 1.574090 0.4112246 9.385413 3.827810 3.740473e-03 0.0449299461
## Q8IXW5 3.388153 0.8332024 7.009655 4.066422 4.756881e-03 0.0479403182
## Q8N474 -3.304647 0.3784419 7.847514 -8.732243 2.605475e-05 0.0070101764
## Q8N5M1 -2.022143 0.4573254 8.937206 -4.421672 1.695806e-03 0.0316964755
## Q8NAT1 -1.416451 0.2751694 9.385413 -5.147559 5.297748e-04 0.0181177896
## Q8NBF2 -1.164826 0.3132700 9.379760 -3.718280 4.451514e-03 0.0479403182
## Q8NFQ8 -1.244891 0.3112852 7.843418 -3.999198 4.116783e-03 0.0466119152
## Q8TBP6 -1.893243 0.3673308 8.851865 -5.154053 6.322741e-04 0.0197464077
## Q8TBQ9 -2.761806 0.4223033 8.170120 -6.539863 1.643366e-04 0.0116347170
## Q8TDB6 -1.611315 0.3613218 9.153547 -4.459500 1.513753e-03 0.0298341576
## Q8WWA0 -5.806975 0.9532620 8.244689 -6.091688 2.587726e-04 0.0136858216
## Q8WY22 -1.839442 0.3608464 8.385413 -5.097577 8.063838e-04 0.0221210678
## Q8WZA9 -1.502201 0.2907398 9.101344 -5.166822 5.689978e-04 0.0186759790
## Q92508 4.071001 0.5712249 6.385413 7.126791 2.898967e-04 0.0136858216
## Q92604 -2.270281 0.4316583 9.345516 -5.259442 4.604688e-04 0.0163991516
## Q92621 -1.755581 0.3415656 9.385413 -5.139808 5.355012e-04 0.0181177896
## Q92681 -2.153054 0.4353071 8.133279 -4.946057 1.073009e-03 0.0253280032
## Q92736-2 -3.330740 0.5744993 8.908498 -5.797640 2.705895e-04 0.0136858216
## Q96C86 -1.515572 0.3020943 9.145534 -5.016883 6.878255e-04 0.0198707711
## Q96CS3 -1.329185 0.3488970 9.119924 -3.809678 4.055681e-03 0.0462918574
## Q96FJ2 1.591193 0.4148520 8.139895 3.835568 4.818572e-03 0.0479403182
## Q96H79 -3.021670 0.5420367 6.334231 -5.574659 1.178500e-03 0.0265817282
## Q96LL9 -2.426640 0.3958291 8.842792 -6.130526 1.858099e-04 0.0117873185
## Q96PK6 -1.284104 0.3320346 9.148491 -3.867380 3.688335e-03 0.0448514075
## Q9BS26 -1.226358 0.3132596 9.249914 -3.914831 3.356392e-03 0.0425104704
## Q9BTV4 -1.810463 0.4381260 9.284468 -4.132288 2.386151e-03 0.0361484051
## Q9BUF5 -1.934378 0.4345654 9.217423 -4.451293 1.506001e-03 0.0298341576
## Q9BVC6 -1.637083 0.4433031 9.341936 -3.692921 4.666463e-03 0.0479403182
## Q9BW30 -2.738684 0.4828316 9.049210 -5.672131 2.988162e-04 0.0137862942
## Q9BXN1 -2.670923 0.5132981 8.937487 -5.203455 5.742101e-04 0.0186759790
## Q9BXR6 -2.352662 0.5252419 9.382448 -4.479196 1.383137e-03 0.0283324933
## Q9GZY4 -3.167768 0.5759744 7.703311 -5.499842 6.538627e-04 0.0198707711
## Q9H1E5 -1.388829 0.3280259 9.385413 -4.233902 1.996912e-03 0.0337810919
## Q9HAV4 -2.205274 0.4388018 7.987893 -5.025671 1.024314e-03 0.0244630235
## Q9HB40 -2.173414 0.4870876 6.179009 -4.462060 3.977997e-03 0.0461447703
## Q9HCB6 -1.808880 0.4871150 8.648303 -3.713455 5.166624e-03 0.0497073269
## Q9NY15 -2.177423 0.4377625 9.336638 -4.973982 6.860043e-04 0.0198707711
## Q9NZ01 -2.346040 0.4161143 8.691035 -5.637970 3.617534e-04 0.0148852775
## Q9P2B2 -2.047509 0.3731311 9.385413 -5.487373 3.334659e-04 0.0141028305
## Q9UBB5 2.673301 0.4015137 6.385413 6.658059 4.276930e-04 0.0157857598
## Q9UBG0 -2.576210 0.3963719 9.131671 -6.499476 1.044441e-04 0.0097521471
## Q9UBI9 -2.822134 0.6797511 7.613412 -4.151717 3.566988e-03 0.0441523496
## Q9UGT4 -2.283615 0.4020386 9.193722 -5.680088 2.789223e-04 0.0136858216
## Q9UK22 -1.968950 0.4285590 6.372397 -4.594351 3.184748e-03 0.0422551508
## Q9UKS6 1.443688 0.3439564 8.943424 4.197299 2.348462e-03 0.0358449483
## Q9UKX3 2.040096 0.5408257 9.208912 3.772187 4.224121e-03 0.0471151958
## Q9UL18 -2.602312 0.3982234 8.037138 -6.534804 1.776730e-04 0.0116347170
## Q9ULC3 -1.674808 0.3626400 8.669266 -4.618376 1.387449e-03 0.0283324933
## Q9ULL5-3 -3.386308 0.3993822 7.893242 -8.478865 3.107960e-05 0.0070101764
## Q9UNW9 4.097053 0.8545595 9.054127 4.794344 9.650322e-04 0.0236025958
## Q9UQ35 -1.367511 0.3203946 9.385413 -4.268208 1.895756e-03 0.0334035492
## Q9Y287 -1.918702 0.5175377 9.385413 -3.707366 4.524555e-03 0.0479403182
## Q9Y2D4 -1.989829 0.5205860 8.653139 -3.822287 4.382964e-03 0.0479403182
## Q9Y2Z0 -1.757978 0.4412870 9.385413 -3.983751 2.931706e-03 0.0405659955
## Q9Y3B4 -1.254563 0.3315970 9.218746 -3.783396 4.142907e-03 0.0466119152
## Q9Y5U8 -3.988833 0.8897580 9.327097 -4.483053 1.395689e-03 0.0283324933
## Q9Y6X5 -1.411435 0.3280595 8.750753 -4.302375 2.117117e-03 0.0348421424
for (protName in sigNames[1:5])
{
pePlot <- pe[protName, , c("peptideNorm","proteinRobust")]
pePlotDf <- data.frame(longFormat(pePlot))
pePlotDf$assay <- factor(pePlotDf$assay,
levels = c("peptideNorm", "proteinRobust"))
pePlotDf$region <- as.factor(colData(pePlot)[pePlotDf$colname, "region"])
# plotting
p1 <- ggplot(data = pePlotDf,
aes(x = colname, y = value, group = rowname)) +
geom_line() + geom_point() + theme_minimal() +
facet_grid(~assay) + ggtitle(protName)
print(p1)
# plotting 2
p2 <- ggplot(pePlotDf, aes(x = colname, y = value, fill = region)) +
geom_boxplot(outlier.shape = NA) + geom_point(position = position_jitter(width = .1),
aes(shape = rowname)) +
scale_shape_manual(values = 1:nrow(pePlotDf)) +
labs(title = protName, x = "sample", y = "peptide intensity (log2)") + theme_minimal()
facet_grid(~assay)
print(p2)
}